package AJava1月.EJava第五周.练习题02;

import java.util.Scanner;

public class B求平方根 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int number = sc.nextInt();

        for (int i = 1; i <= number; i++) {
            if(i * i == number){
                System.out.println(number+"的平方根就是"+i);
                break;
            }else if(i*i > number){
                System.out.println(number+"的平方根整数部分就是"+(i-1));
                break;
            }

        }

    }

    }
